
package io.fredia.femicro.tool.search.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import io.fredia.femicro.api.vo.search.IndexObject;
import io.fredia.femicro.common.msg.TableResultResponse;
import io.fredia.femicro.tool.search.lucene.LuceneDao;
import io.fredia.femicro.tool.search.service.LuceneService;

@Service
public class LuceneServiceImpl implements LuceneService {

	@Autowired
	private LuceneDao luceneDao;

	@Override
	public void save(IndexObject indexObject) {
		luceneDao.create(indexObject);
	}

	@Override
	public void update(IndexObject indexObject) {
		luceneDao.update(indexObject);
	}

	@Override
	public void delete(IndexObject indexObject) {
		luceneDao.delete(indexObject);
	}

	@Override
	public void deleteAll() {
		luceneDao.deleteAll();
	}

	@Override
	public TableResultResponse page(Integer pageNumber, Integer pageSize, String keyword) {
		return luceneDao.page(pageNumber, pageSize, keyword);
	}
}
